import request from '@/utils/request.js'
const PATH = '/admin/courseVideo'

// 新增课程视频
export const insertCourseVideo = (data) => {
  return request.post(PATH + '/insert', data)
}

// 分页查询课程视频
export const getCourseVideoList = ({
  page,
  pageSize,
  courseName,
  categoryId
}) => {
  return request.get(PATH + '/page', {
    params: {
      page,
      pageSize,
      courseName,
      categoryId
    }
  })
}

// 根据id查询课程视频
export const getCourseVideoById = (id) => {
  return request.get(PATH + '/getCourseVideoById', {
    params: {
      id
    }
  })
}

// 修改课程视频
export const updateCourseVideo = (data) => {
  return request.put(PATH + '/update', data)
}

// 批量删除课程视频
export const batchDeleteCourseVideo = (ids) => {
  return request.delete(PATH + '/batchDelete', {
    params: {
      ids: ids.join(',')
    }
  })
}
